import Router from "vue-router";

import home from "@/view/home.vue";

const routerPush = Router.prototype.push;
Router.prototype.push = function (location) {
  return routerPush.call(this, location).catch((err) => {});
};

let routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    name: "/home",
    component: home,
    children: [],
  },
  {
    path: "/aboutUs",
    name: "/aboutUs",
    component: () => import("@/view/aboutUs.vue"),
  },
  {
    path: "/career",
    name: "/career",
    component: () => import("@/view/career.vue"),
  },
  {
    path: "/college",
    name: "/college",
    component: () => import("@/view/college.vue"),
  },
  {
    path: "/contact",
    name: "/contact",
    component: () => import("@/view/contact.vue"),
  },
  {
    path: "/factory",
    name: "/factory",
    component: () => import("@/view/factory.vue"),
  },
  {
    path: "/innovate",
    name: "/innovate",
    component: () => import("@/view/innovate.vue"),
  },
  {
    path: "/journalism",
    name: "/journalism",
    component: () => import("@/view/journalism.vue"),
  },
  {
    path: "/journalism_detail",
    name: "/journalism_detail",
    component: () => import("@/view/journalism_detail.vue"),
  },
  {
    path: "/product",
    name: "/product",
    component: () => import("@/view/product.vue"),
  },
  {
    path: "/product_detail",
    name: "/product_detail",
    component: () => import("@/view/product_detail.vue"),
  },
  {
    path: "/college_detail",
    name: "/college_detail",
    component: () => import("@/view/college_detail.vue"),
  },
];

let router = new Router({
  routes,
});

export default router;
